package cn.itcast.service;

import cn.itcast.mapper.EmpMapper;
import cn.itcast.pojo.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class EmpService {
    @Autowired
    private EmpMapper empMapper;

    public Emp findEmpById(int id) throws InterruptedException {
        int a =new Random().nextInt(2000);
        System.out.println(a);
        Thread.sleep(a);
        Emp emp = empMapper.selectByPrimaryKey(id);
        return emp;

    }
}
